#include #include #include #include using namespace std; string reverse(string s) { string result = ""; for(int i = s.length()-1; i >=0; i--) { result += s[i]; } return result; } void main() { string s; cin >> s; string sr = reverse(s); cout << sr << endl; list myChars; for(int i = 0; i < s.length(); i++) { myChars.push_back(s[i]); } myChars.reverse(); string s2 = ""; list::iterator i = myChars.begin(); while(i != myChars.end()) { s2 += *i; i++; } cout << s2 << endl; //list stuff; // //int x; //do //{ // cin >> x; // if(x != 0) // { // stuff.push_back(x); // } //} //while(x != 0); ////do ////{ //// cin >> x; //// if(x != 0) //// { //// stuff.push_front(x); //// } ////} ////while(x != 0); // //list::iterator i = stuff.begin(); //i++; //i++; //stuff.insert(i,32342); //i--; //i--; //stuff.erase(i); //stuff.remove(5);// remove items with the value 5 //i = stuff.begin(); //while(i != stuff.end()) //{ // cout << *i << endl; // i++; //} ////for(int i = 0; i < stuff.size(); i++) ////{ //// cout << stuff.at(i) << endl; ////} }